import React, { useState } from 'react';
import {
  Button,
  Cascader,
  DatePicker,
  Form,
  Input,
  InputNumber,
  Radio,
  Select,
  Switch,
  TreeSelect,
} from 'antd';
import type { FormProps } from 'antd';
import { useParams } from 'next/navigation';
import axios from 'axios';

type SizeType = Parameters<typeof Form>[0]['size'];
interface EditProps {
  obj:any
  handleOk:()=>void
  handleAdd:(values:any)=>void
}
const Edits = (props:EditProps) => {
  const {obj,handleOk,handleAdd}=props
  console.log(handleOk)

  const onFinish: FormProps<any>['onFinish'] = async(values) => {
    console.log('Success:', values);
    let obj={
      title:values.title,
      dingdan:values.dingdan,
      jine:values.jine,
      date:values.date
    }
    handleOk()
    handleAdd(values)

  };


  return (
    <Form
      layout="horizontal"
      onFinish={onFinish}
      style={{ maxWidth: 600 }}>
      <Form.Item label="客户名称" name="title"  rules={[{ required: true,message:'请输入客户名称' }]}>
        <Input />
      </Form.Item>
      <Form.Item label="订单标题" name="dingdan"  rules={[{ required: true ,message:'请输入订单标题'}]}>
        <Input />
      </Form.Item>
      <Form.Item label="汇款期次" name="num" rules={[{ required: true ,message:'请输入汇款期次'}]}>
        <Input />
      </Form.Item>
      <Form.Item label="订单总金额" name="jine" rules={[{ required: true ,message:'请输入订单总金额'}]}>
        <Input />
      </Form.Item>
      <Form.Item label="已汇款金额" name="money" rules={[{ required: true ,message:'请输入已汇款金额'}]}>
        <Input />
      </Form.Item>
      <Form.Item>
      <Button type="primary" htmlType="submit">下一步</Button>
      </Form.Item>
    </Form>
  );
};

export default Edits;